﻿using System.ComponentModel.DataAnnotations.Schema;

namespace FDSimpleModelGenerator.Entities.CreateTables
{
    /// <summary>
    /// 生成表的列信息
    /// </summary>
    [Table("tab_column")]
    public class Column : Entity
    {
        /// <summary>
        /// 列名
        /// </summary>
        public string Name { get; set; }
        /// <summary>
        /// 是否主键
        /// </summary>
        public bool PrimaryKey { get; set; }
        /// <summary>
        /// 数据类型
        /// </summary>
        public string DataType { get; set; }
        /// <summary>
        /// 长度
        /// </summary>
        public int Length { get; set; }
        /// <summary>
        /// 小数精度
        /// </summary>
        public int Precision { get; set; }
        /// <summary>
        /// 是否可空
        /// </summary>
        public bool AllowNulls { get; set; }
        /// <summary>
        /// 无符号（目前已知mysql）
        /// </summary>
        public bool Unsigned { get; set; }
        /// <summary>
        /// 默认值
        /// </summary>
        public string DefaultValue { get; set; }
        /// <summary>
        /// 自增量（针对sqlserver有用，sqlite、mysql不可用)
        /// </summary>
        public int IncrementValue { get; set; }
        /// <summary>
        /// 字段备注
        /// </summary>
        public string Remark { get; set; }

        /// <summary>
        /// 表Id
        /// </summary>
        public int TableId { get; set; }
    }
}
